package com.example.myapplication.database


import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.myapplcation.entity.PopularScienceMineEntity

@Dao
interface DataBaseDao {
    @Insert
    fun insertPopularScience(popularScience: PopularScienceMineEntity)

    @Query("SELECT * FROM popular_science ORDER BY createTime DESC")
    fun queryAllPopularScience():MutableList<PopularScienceMineEntity>

    @Query("SELECT * FROM popular_science WHERE id = :id")
    fun queryAllPopularScienceForId(id:Long):PopularScienceMineEntity?

}